package com.mew.lobby.provide;

import com.mew.common.exception.ResponseCode;
import com.mew.common.rest.user.SimpleUserResponseMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author dylin
 * @create 2021/5/11
 */
@Component
@FeignClient(value = "mew-kernel-user")
@RequestMapping("/friend")
public interface FriendFeignService {
    /**
     * 申请列表
     * @param userId
     * @return
     */
    @GetMapping("/applys")
    @ResponseBody
    SimpleUserResponseMessage getFriendApplys(@RequestParam("userId")long userId);
    /**
     * 好友列表
     * @param userId
     * @return
     */
    @GetMapping("/friends")
    @ResponseBody
    SimpleUserResponseMessage getFriends(@RequestParam("userId")long userId);
    /**
     * 推荐好友列表
     * @param userId
     * @return
     */
    @GetMapping("/random")
    @ResponseBody
    SimpleUserResponseMessage getRandomUser(@RequestParam("userId")long userId,@RequestParam("limit")int limit);
    /**
     * 操作申请
     * @return
     */
    @GetMapping("/apply_update")
    @ResponseBody
    int updateApply(@RequestParam("userId")long userId,@RequestParam("friendId")long friendId,@RequestParam("status")int status);
    /**
     * 添加好友
     * @return
     */
    @GetMapping("/add")
    @ResponseBody
    int addFriend(@RequestParam("userId")long userId,@RequestParam("friendId")long friendId);

    /**
     * 删除好友
     * @return
     */
    @GetMapping("/delete")
    @ResponseBody
    int deleteFriend(@RequestParam("userId")long userId,@RequestParam("friendId")long friendId);
    /**
     * 赠送
     * @return
     */
    @GetMapping("/give")
    @ResponseBody
    int give(@RequestParam("userId")long userId,@RequestParam("friendId")long friendId);
    /**
     * 全部赠送
     * @return
     */
    @GetMapping("/give_batch")
    @ResponseBody
    int giveAll(@RequestParam("userId")long userId);
}
